package com.mall.b2c.domain.card;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.mall.b2c.domain.member.MemberDomain;
import com.mall.common.domain.BaseEntity;

import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Date;

/**
 * Created by chen on 17/1/19.
 */
@Entity
@Table(name = "b2c_card")
public class CardDomain extends BaseEntity {

    private BigDecimal money;
    private Integer intergral;
    private Date overtime;
    @JsonIgnore
    private MemberDomain memberDomain;
    private String password;
    private boolean isUsed;
    private boolean isActivate;

    public boolean getIsActivate() {
        return isActivate;
    }

    public void setIsActivate(boolean activate) {
        isActivate = activate;
    }

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "member_id")
    public MemberDomain getMemberDomain() {
        return memberDomain;
    }

    public void setMemberDomain(MemberDomain memberDomain) {
        this.memberDomain = memberDomain;
    }

    public boolean getIsUsed() {
        return isUsed;
    }

    public void setIsUsed(boolean used) {
        isUsed = used;
    }

    public BigDecimal getMoney() {
        return money;
    }

    public void setMoney(BigDecimal money) {
        this.money = money;
    }

    public Integer getIntergral() {
        return intergral;
    }

    public void setIntergral(Integer intergral) {
        this.intergral = intergral;
    }

    public Date getOvertime() {
        return overtime;
    }

    public void setOvertime(Date overtime) {
        this.overtime = overtime;
    }


    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    @Transient
    public Long getAccount() {
        return 100000000000L + getId();
    }

}
